<!doctype html>
<html class="x-admin-sm">

<head>
  {include file="public/head"}
</head>

<body>
  <!-- 顶部开始 -->
  <div class="container">
    <div class="logo"><a href="/admin.php/Home/index">{$site.values}-后台管理系统</a></div>
    <div class="left_open">
      <i title="展开左侧栏" class="iconfont">&#xe699;</i>
    </div>
    <ul class="layui-nav right" lay-filter="">
      <li class="layui-nav-item">
        <a href="javascript:;">{$role.title}-{$admin.username}</a>
        <dl class="layui-nav-child">
          <dd><a onclick="edit({$admin.id})">修改密码</a></dd>
          <dd><a href="/admin.php/account/login" target="_blank">切换帐号</a></dd>
          <dd><a onclick="logout()">退出</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item to-index"><a href="/">前台首页</a></li>
    </ul>
  </div>
  <!-- 顶部结束 -->
  <!-- 中部开始 -->
  {include file="public/left_menu"}
  <!-- 右侧主体开始 -->
  <div class="page-content">
    <div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
      <ul class="layui-tab-title">
        <li class="home"><i class="layui-icon">&#xe68e;</i>我的桌面</li>
      </ul>
      <div class="layui-unselect layui-form-select layui-form-selected" id="tab_right">
        <dl>
          <dd data-type="this">关闭当前</dd>
          <dd data-type="other">关闭其它</dd>
          <dd data-type="all">关闭全部</dd>
        </dl>
      </div>
      <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
          <iframe src="{:url('home/welcome')}" frameborder="0" scrolling="yes" class="x-iframe"></iframe>
        </div>
      </div>
      <div id="tab_show"></div>
    </div>
  </div>
  <div class="page-content-bg"></div>
  <!-- 右侧主体结束 -->
  <!-- 中部结束 -->
  <!-- 底部开始 -->
  <div class="footer" style="text-align: center;">
    <div class="copyright">Copyright ©2020 liwenlong All Rights Reserved</div>
  </div>
  <!-- 底部结束 -->
  <script>
    // 修改密码
    function edit(id){
			layer.open({
			  type: 2,
			  title: '修改密码',
			  shade: 0.3,
			  area: ['480px', '420px'],
			  content: '/admin.php/Admin/edit?id='+id
			});
		}
    // 退出
		function logout() {
			layer.confirm('确定要退出登录吗？', {
        icon: 3,
				btn: ['确定', '取消']
			}, function () {
				$.get('/admin.php/account/logout', function (res) {
					if (res.code > 0) {
						layer.msg(res.msg, { 'icon': 2 });
					} else {
						layer.msg(res.msg, { 'icon': 1 });
						setTimeout(function () { window.location.href = "/admin.php/account/login"; }, 1000);
					}
				}, 'json');
			});
		}
  </script>
</body>

</html>